package com.template.app.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(ErrorController.ERROR)
public class ErrorController {

	public static final String ERRORS_PATH = "errors/";
	public static final String ERROR = "error";
	
	public static final String _404 = "404";
	public static final String _500 = "500";

	@RequestMapping(value = _404)
    public String handle404() {
        return error(_404);
    }
	
	@RequestMapping(value = _500)
    public String handle500() {
        return error(_500);
    }
	
	private String error(String error) {
		return ERRORS_PATH + error;
	}

}
